package com.wing.cabinet.model.response;

import com.wing.cabinet.model.entity.StorageInventoryInout;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.wing.cabinet.model.entity.StorageInventoryInoutDetail;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 暂存柜存刀/取刀;存/取维修/回收刀明细VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class StorageInventoryInoutDetailVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 暂存柜存刀id
     */
    private Long inoutId;

    /**
     * 柜子id
     */
    private Long cabId;

    /**
     * sku id
     */
    private Long skuId;

    /**
     * 数量
     */
    private Integer quantity;

    /**
     * 企业id
     */
    private Long companyId;

    /**
     * 货道id
     */
    private Long spaceId;

    /**
     * 操作类型
     */
    private StorageInventoryInoutDetail.OperationType operationType;

    /**
    * 操作类型描述
    */
    @TableField(exist = false)
    private String operationTypeDesc;

    public String getOperationTypeDesc() {
        return operationType.getDesc();
    }

    /**
     * 业务类型
     */
    private StorageInventoryInoutDetail.BusinessType businessType;

    /**
     * 业务类型
     */
    private StorageInventoryInoutDetail.BusinessTypeChecked businessTypeChecked;

    /**
    * 业务类型描述
    */
    @TableField(exist = false)
    private String businessTypeDesc;

    public String getBusinessTypeDesc() {
        return businessType.getDesc();
    }

    /**
     * 柜子编号
     */
    private String cabCode;

    /**
     * sku 编号
     */
    private String skuCode;

    /**
     * 货道编号
     */
    private String spaceCode;

    /**
     * 当前库存
     */
    private Integer quantityCurrent;

    /**
     * 变动后库存
     */
    private Integer quantityAfter;


    /**
     * 签收数量
     */
    private Integer quantitySign;

    /**
     * 维修价格
     */
    private BigDecimal repairPrice;

    private String checkCode;



    /**
     * 产品sku名称
     */
    private String skuName;







    /**
     * 产品规格
     */
    private String skuSpec;



    /**
     * sku 图片
     */
    private String skuPic;

    /**
     * 产品名称
     */
    private String productName;

    /**
     * 产品类型名称
     */
    private String productTypeName;

    /**
     * 产品分类名称
     */
    private String productCategoryName;

    /**
     * 产品品牌
     */
    private String productBrandName;

    /**
     * 产品型号
     */
    private String productModelName;

    /**
     * 适配机床
     */
    private String deviceName;

    /**
     * 市场价
     */
    private BigDecimal marketPrice;

    private Integer quantityMax;

    /**
     * 单位
     */
    private String unitName;


    /**
     * 签收人id
     */
    private Long signUserId;

    /**
     * 签收人
     */
    private String signUserName;

    /**
     * 签收时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime signTime;

    /**
     * 维修厂商
     */
    private String repairCompany;

    private Long checkedResultId;

    private String workshopName;

    private String floor;

    /**
     * 供应商id
     */
    private Long supplierId;

    /**
     * 供应商名称
     */
    private String supplierName;

    //detail

    private String cabName;

    private String workshopLocation;

    private String enterpriseName;


    private String code;


    /**
     * 盘验时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime checkTime;

    /**
     * 盘验人id
     */
    private Long checkUserId;

    /**
     * 盘验人
     */
    private String checkUserName;

    /**
     * 通知时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime notifyTime;

    /**
     * 通知人
     */
    private Long notifyUserId;

    /**
     * 通知人
     */
    private String notifyUserName;

    /**
     * 回收人id
     */
    private Long takeUserId;

    /**
     * 回收人
     */
    private String takeUserName;

    /**
     * 回收时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime takeTime;

    private String labelCode;

    /**
     * 包装码
     */
    private String parentCode;

    private Integer quantityChecked;

    /**
     * 企业编码
     */
    private String enterpriseCode;


    private BigDecimal price;

    private BigDecimal total;

    private StorageInventoryInoutDetail.LoadingType loadingType;

    private Long categoryId;

    private Integer quantitySingleCabCurrent;

    private Integer quantitySingleCabAfter;

    private Integer quantityCabCurrent;

    private Integer quantityCabAfter;

    private Integer quantityUserCurrent;

    private Integer quantityUserAfter;


    private Integer settingTime;


    private Integer remainingTime;

    private Integer useTime;


    /**
     * 寿命单位  1：小时/ 2：次数
     */
    private StorageInventoryInoutDetail.LifeUnit lifeUnit;

    private String lifeUnitDesc;

    public String getLifeUnitDesc(){
        if(this.lifeUnit != null){
            return this.lifeUnit.getDesc();
        }
        return "";
    }

    private String mainCabCode;

    private Integer quantityPack;

    private Integer quantityPackUnit;

    private Long packId;

    private String packName;

    private Integer quantityPackCurrent;

    private Integer quantityPackAfter;


    private Integer quantityPackSingleCabCurrent;

    private Integer quantityPackSingleCabAfter;


    private Integer quantityPackCabCurrent;

    private Integer quantityPackCabAfter;

    private String causeName;

    /**
     * 规格码
     */
    private String skuSpecOld;

    /**
     * 机台号
     */
    private String deviceCode;

}
